<?php
class LoginCheck {
	function check() {
		$RTR =& load_class('Router');
		$method = $RTR->fetch_method(); 
		$class = $RTR->fetch_class(); 
		if (in_array($class, array('login', 'api'))) {
			return TRUE;
		}
		$ci =& get_instance();
		$login = $ci->session->userdata('login');
		if ($login) {
			return TRUE;
		}

		header("Location: /login");
	}
}
